<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        var key='address';
    var paramstr='name=tom&age=19&adress=长沙';
    function getParams(paramstr,key)
    var params=paramstr.split('&');
    for (let i=0;i<params.length;i++){
        let index=params[i].indexOf('=');
    let name =params[i].subString(0,index);
    }
   
    if(name==key){
        let value=params[i].substr(index+1);
        return value;
        //console.log(value);
    }else{

    }
    return undefined;
    </script>
</body>
</html>